package main

import "fmt"

func main() {
	d := []int{4,1,2,1,2}
	fmt.Println(singleNumber(d))
}

func singleNumber(nums []int) int {
	a :=nums[0]
	for i:=1;i<len(nums);i++ {
		a ^=nums[i]
	}

	return a 
}
